<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <ui:composition template="layout.xhtml">
        <ui:define name="body">
            <script type="text/javascript">
                function printDiv(divName) {
                    var printContents = document.getElementById(divName).innerHTML;
                    var originalContents = document.body.innerHTML;

                    document.body.innerHTML = printContents;

                    window.print();

                    document.body.innerHTML = originalContents;
                }
            </script>
            <h2>Formulário Questionário</h2>
            <p:panel >
                <h:form id="form" acceptcharset="utf-8">
                    <p:commandButton value="Imprimir" 
                                     onclick="printDiv('questionario')" style="float:right; margin-top: 10px;"
                                     update="@form" immediate="true" icon="ui-icon-print" />
                    <p:growl id="msg" life="5000"/>
                    <p class="subtitle">Questionário Preparatório para Inspenção Correcional de Cartório</p>

                        <h:panelGrid columns="4" style=" color: #000000; width: 102%; margin-left: -18px; font-family: sans-serif" >
                            <p:outputLabel value="Município/Comarca:" style="float: right"/>  
                            <p:inputText size="40"/>
                            <p:outputLabel value="Código :" style="float: right; padding-left: 50px;"/>  
                            <p:inputText size="30"/>
                            <p:outputLabel value="Denomin. da Serventia:" style="float: right"/>  
                            <p:inputText size="40"/>
                            <p:outputLabel value="Natureza da Serventia:" style="float: right; padding-left: 50px;"/>  
                            <p:inputText size="30"/>
                            <p:outputLabel value="Nome do Delegatário:" style="float: right"/>  
                            <p:inputText size="40"/>
                            <p:outputLabel value="CPF n˚ :" style="float: right; padding-left: 50px;"/>  
                            <p:inputText size="30"/>
                            <p:outputLabel value="Modo de Ingresso:" style="float: right"/>  
                            <p:selectOneRadio id="options" >  
                                <f:selectItem itemLabel="Concurso" itemValue="1" />  
                                <f:selectItem itemLabel="Designado" itemValue="2" />  
                                <f:selectItem itemLabel="Interventor" itemValue="3" />  
                            </p:selectOneRadio>
                            <p:outputLabel value="Data da Posse:" style="float: right; padding-left: 50px;"/>  
                            <p:inputText size="30"/>
                            <p:outputLabel value="End. da Serventia:" style="float: right; padding-left: 50px;"/>  
                            <p:inputText size="40"/>
                            <p:outputLabel value="Bairro:" style="float: right; padding-left: 50px;"/>  
                            <p:inputText size="30"/>
                            <p:outputLabel value="Complemento:" style="float: right; padding-left: 50px;"/>  
                            <p:inputText size="40"/>
                            <p:outputLabel value="CEP:" style="float: right; padding-left: 50px;"/>  
                            <p:inputText size="30"/>
                            <p:outputLabel value="CNPJ:" style="float: right; padding-left: 50px;"/>  
                            <p:inputText size="40"/>
                            <p:outputLabel value="Telefone fixo:" style="float: right; padding-left: 50px;"/>  
                            <p:inputText size="30"/>
                            <p:outputLabel value="email:" style="float: right; padding-left: 50px;"/>  
                            <p:inputText size="40"/>
                            <p:outputLabel value="Telefone celular:" style="float: right; padding-left: 50px;"/>  
                            <p:inputText size="30"/>

                        </h:panelGrid>
                    <p class="subtitle">Perguntas e Alternativas</p>


                        <ui:repeat value="#{managerEditCategory.categorys}" var="c">
                            <table style="width:100%;">
                                <tr style="color:#3DA2DC; width: 100%; font-size: 13px; font-family: sans-serif">
                                    <td>
                                        <p:panel header="#{c.name} " style="border: 0px; width:100%;"/>         
                                    </td>       
                                   
                                </tr> 
                            </table>

                            <ul>
                                <ol style="padding-left: 30px; color: #000000;">

                                    <ui:repeat value="#{c.issueses}" var="i">
                                        <table style="float : right;position: relative">
                                            <tr>
                                                
                                            </tr>
                                        </table>
                                        <li style="font-weight: bold;width: 90%;float: left;min-height: 14px; margin-left: 5px; ">
                                            <span  style="color: #000000; font-weight: bold;" > #{i.title} </span> 
                                        </li>

                                        <ol type="a" class="opt" style=" vertical-align: top ;width: 100%;float: left">

                                            <p:inputTextarea rendered="#{i.typeIssues eq 'OPEN'}" cols="60" />

                                            <ui:repeat  value="#{i.options}" var="o">
                                                <li style="float: left;width: 100%;padding-left: 25px"> 
                                                    <p:selectOneRadio rendered="#{i.typeIssues eq 'CHOOSEONE'}" style="float: left;display: block" id="options" >    <f:selectItem itemLabel="" itemValue="1" />   </p:selectOneRadio>
                                                    <p:selectBooleanCheckbox  rendered="#{i.typeIssues eq 'CHOICEMULTIPLE'}" />  
                                                    <span >#{o.title} </span>

                                                </li>

                                            </ui:repeat>

                                            <h:outputText value="Orientação * " style="color: #3DA2DC; font-weight: bold" rendered="#{i.orientacion eq empty 'null'}"/>
                                            <h:outputText value="#{i.orientacion}" rendered="#{i.orientacion eq empty 'null'}"/> 
                                        </ol>

                                    </ui:repeat>

                                </ol>

                            </ul>

                        </ui:repeat>
                    <center>
                        <p:commandButton value="Voltar" icon="ui-icon-arrowreturnthick-1-w" style="font-size: 12px; font-family: sans-serif;" actionListener="#{managerRedirect.redirect('viewQuestionnaire.xhtml')}" immediate="true"/>
                    </center>
                </h:form>
            </p:panel>
        </ui:define>
    </ui:composition>
</html>





